package com.group.service.impl;

import com.group.mapper.CommentMapper;
import com.group.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.entity.Comment;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    private CommentMapper commentMapper;

    @Override
    public int addComment(Comment comment) {
        return commentMapper.insertComment(comment);
    }

    @Override
    public List<Comment> showCommentByGoodId(Long goodId) {
        return commentMapper.selectCommentByID(goodId);
    }

    @Override
    public int deleteCommentById(Long id) {
        return commentMapper.deleteCommentByID(id);
    }
}
